test: deflake test_pre_existing_request_with_user_data in single RQ mode#959
Merged
Merged
Conversation
The request is added by a different producer, so single-mode immediate consistency does not apply; poll up to 30s for the write to propagate instead of relying on rq_poll_timeout (0 in single mode).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #959 +/- ##
==========================================
+ Coverage 90.00% 90.04% +0.03%
==========================================
Files 49 49
Lines 3053 3053
==========================================
+ Hits 2748 2749 +1
+ Misses 305 304 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pijukatel
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deflakes
test_pre_existing_request_with_user_data[single], which intermittently failed in CI withassert None is not None(e.g. this run).Root cause
The test adds a request via a different producer (the raw
apify_client_asyncclient), then fetches it with the single-mode client under test. In single mode therq_poll_timeoutfixture is0, sopoll_until_conditioncallsfetch_next_requestexactly once — a singlelist_headAPI call with no retry. Single-mode "reads are immediately consistent" only holds for the client's own writes; an external producer's write that hasn't yet propagated tolist_headreturnsNone, and with zero retries the assertion fails.Fix
Poll with a generous 30s ceiling regardless of access mode (matching what shared mode already does), instead of
rq_poll_timeout=0. The now-unusedrq_poll_timeoutparameter is dropped. The[shared]parametrization already usedtimeout=30and was unaffected.